```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Git Rebase 完全指南 - 技术小馆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
        }
        .code-block {
            background-color: #2d2d2d;
            color: #f8f8f2;
            border-radius: 6px;
            padding: 1.5rem;
            font-family: 'Courier New', Courier, monospace;
            position: relative;
        }
        .code-block:before {
            content: '';
            position: absolute;
            top: 12px;
            left: 12px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #ff5f56;
            box-shadow: 20px 0 #ffbd2e, 40px 0 #27c93f;
        }
        .card {
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
        }
        .mermaid-chart {
            background: white;
            padding: 2rem;
            border-radius: 8px;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl text-center">
            <div class="flex justify-center mb-6">
                <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm font-medium flex items-center">
                    <i class="fas fa-code-branch mr-2"></i> Git 高级技巧
                </span>
            </div>
            <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">掌握 Git Rebase：让提交历史更清晰</h1>
            <p class="text-xl md:text-2xl opacity-90 max-w-3xl mx-auto mb-8">学习如何像专业开发者一样整理你的Git提交历史，创建更干净、更线性的项目时间线</p>
            <div class="flex justify-center space-x-4">
                <a href="#basic-syntax" class="bg-white text-purple-700 px-6 py-3 rounded-full font-medium hover:bg-opacity-90 transition-all">
                    <i class="fas fa-book-open mr-2"></i> 开始学习
                </a>
                <a href="#mermaid-chart" class="bg-transparent border-2 border-white px-6 py-3 rounded-full font-medium hover:bg-white hover:bg-opacity-10 transition-all">
                    <i class="fas fa-project-diagram mr-2"></i> 查看流程图
                </a>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-5xl px-4 py-12 md:py-16">
        <!-- Introduction -->
        <section class="mb-16">
            <div class="prose prose-lg max-w-none">
                <p class="text-gray-700 text-lg leading-relaxed">
                    <span class="text-4xl float-left mr-2 -mt-1 font-serif font-bold text-purple-600">在</span>
                    Git 中，<code class="bg-gray-100 px-1.5 py-0.5 rounded">rebase</code> 是一个用于重新应用一系列提交的操作，它的主要作用是将一条分支上的更改"移动"到另一条分支的基础上。这可以帮助整理提交历史，使其更加清晰，并避免多余的合并提交。<code class="bg-gray-100 px-1.5 py-0.5 rounded">rebase</code> 的语法和使用方式可以有多个变体，每种都有其特定的应用场景。
                </p>
            </div>
        </section>

        <!-- Basic Syntax Section -->
        <section id="basic-syntax" class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-2 flex items-center">
                <i class="fas fa-terminal mr-3 text-purple-600"></i> 基本语法
            </h2>

            <div class="grid md:grid-cols-1 gap-8">
                <!-- Basic Rebase -->
                <div class="card bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-2xl font-semibold mb-4 text-gray-800 flex items-center">
                        <span class="bg-purple-100 text-purple-800 rounded-full w-8 h-8 flex items-center justify-center mr-3">1</span>
                        基本的 git rebase 语法
                    </h3>
                    <div class="code-block mb-4">
                        <code>git rebase &lt;upstream&gt;</code>
                    </div>
                    <div class="prose">
                        <p><code class="bg-gray-100 px-1.5 py-0.5 rounded">upstream</code> 指的是你希望将当前分支变基到的目标分支或提交。这通常是一个分支名称（如 <code class="bg-gray-100 px-1.5 py-0.5 rounded">master</code> 或 <code class="bg-gray-100 px-1.5 py-0.5 rounded">main</code>），也可以是一个具体的提交哈希值。</p>
                        <h4 class="font-semibold mt-4 mb-2 text-gray-700">示例:</h4>
                        <div class="code-block">
                            <code>git rebase master</code>
                        </div>
                        <p class="mt-2 text-gray-600">将当前分支的变更移到 <code class="bg-gray-100 px-1.5 py-0.5 rounded">master</code> 分支的最新提交之上。</p>
                    </div>
                </div>

                <!-- Interactive Rebase -->
                <div class="card bg-white p-6 rounded-xl shadow-md">
                    <h3 class="text-2xl font-semibold mb-4 text-gray-800 flex items-center">
                        <span class="bg-purple-100 text-purple-800 rounded-full w-8 h-8 flex items-center justify-center mr-3">2</span>
                        交互式重定位
                    </h3>
                    <div class="code-block mb-4">
                        <code>git rebase -i &lt;commit&gt;</code>
                    </div>
                    <div class="prose">
                        <ul class="list-disc pl-5 space-y-1">
                            <li><code class="bg-gray-100 px-1.5 py-0.5 rounded">-i</code> 选项启动交互式重定位，允许你在重定位过程中选择和修改提交。</li>
                            <li><code class="bg-gray-100 px-1.5 py-0.5 rounded">&lt;commit&gt;</code> 是指你希望变基到的提交的哈希值或分支名称。通常，这个 <code class="bg-gray-100 px-1.5 py-0.5 rounded">&lt;commit&gt;</code> 是你当前分支的上游提交，或是你要重定位的起始点的上一个提交。</li>
                        </ul>
                        <h4 class="font-semibold mt-4 mb-2 text-gray-700">示例:</h4>
                        <div class="code-block">
                            <code>git rebase -i HEAD~3</code>
                        </div>
                        <p class="mt-2 text-gray-600">对最近的 3 个提交进行交互式重定位。</p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Common Options Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-2 flex items-center">
                <i class="fas fa-cog mr-3 text-purple-600"></i> 常用的 rebase 选项
            </h2>

            <div class="grid md:grid-cols-2 gap-6">
                <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-100">
                    <h3 class="text-xl font-semibold mb-3 text-gray-800 flex items-center">
                        <i class="fas fa-wrench text-purple-600 mr-2"></i> 主要选项
                    </h3>
                    <ul class="space-y-3">
                        <li>
                            <span class="font-medium text-gray-800">--interactive 或 -i</span>: 
                            <span class="text-gray-600">启动交互式模式，允许用户编辑、合并、删除、重排提交。</span>
                        </li>
                        <li>
                            <span class="font-medium text-gray-800">--onto &lt;newbase&gt;</span>: 
                            <span class="text-gray-600">将提交从指定的起始点（通常是当前分支的上游提交）重定位到新的基础分支 &lt;newbase&gt; 上。</span>
                        </li>
                        <li>
                            <span class="font-medium text-gray-800">--continue</span>: 
                            <span class="text-gray-600">当在 rebase 过程中遇到冲突并解决后，使用此命令继续重定位过程。</span>
                        </li>
                    </ul>
                </div>
                <div class="bg-white p-6 rounded-lg shadow-sm border border-gray-100">
                    <h3 class="text-xl font-semibold mb-3 text-gray-800 flex items-center">
                        <i class="fas fa-exclamation-triangle text-purple-600 mr-2"></i> 其他选项
                    </h3>
                    <ul class="space-y-3">
                        <li>
                            <span class="font-medium text-gray-800">--abort</span>: 
                            <span class="text-gray-600">取消当前的 rebase 操作，并恢复到 rebase 开始前的状态。</span>
                        </li>
                        <li>
                            <span class="font-medium text-gray-800">--skip</span>: 
                            <span class="text-gray-600">跳过当前提交（通常是在处理冲突时，决定不包含该提交）。</span>
                        </li>
                    </ul>
                    <h4 class="font-semibold mt-4 mb-2 text-gray-700">示例:</h4>
                    <div class="code-block text-sm">
                        <code>git rebase --onto master feature_branch</code>
                    </div>
                    <p class="mt-2 text-sm text-gray-600">将 feature_branch 分支的提交移到 master 分支的最新提交之上。</p>
                </div>
            </div>
        </section>

        <!-- How Rebase Works -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-2 flex items-center">
                <i class="fas fa-cogs mr-3 text-purple-600"></i> rebase 的工作原理
            </h2>

            <div class="grid md:grid-cols-4 gap-6">
                <div class="bg-white p-6 rounded-lg shadow-sm text-center">
                    <div class="bg-purple-100 w-14 h-14 rounded-full flex items-center justify-center mx-auto mb-4 text-purple-700">
                        <i class="fas fa-search text-2xl"></i>
                    </div>
                    <h3 class="text-lg font-semibold mb-2 text-gray-800">1. 确定基础</h3>
                    <p class="text-gray-600 text-sm">Git 查找当前分支与指定的上游分支之间的共同祖先提交（base commit）。</p>
                </div>
                <div class="bg-white p-6 rounded-lg shadow-sm text-center">
                    <div class="bg-purple-100 w-14 h-14 rounded-full flex items-center justify-center mx-auto mb-4 text-purple-700">
                        <i class="fas fa-code-commit text-2xl"></i>
                    </div>
                    <h3 class="text-lg font-semibold mb-2 text-gray-800">2. 应用更改</h3>
                    <p class="text-gray-600 text-sm">Git 从共同祖先提交之后的所有提交中，提取出更改并将其应用到指定的新基础上。</p>
                </div>
                <div class="bg-white p-6 rounded-lg shadow-sm text-center">
                    <div class="bg-purple-100 w-14 h-14 rounded-full flex items-center justify-center mx-auto mb-4 text-purple-700">
                        <i class="fas fa-exclamation-circle text-2xl"></i>
                    </div>
                    <h3 class="text-lg font-semibold mb-2 text-gray-800">3. 解决冲突</h3>
                    <p class="text-gray-600 text-sm">如果在应用某个提交时发生冲突，Git 会暂停 rebase 过程，允许用户解决冲突后继续。</p>
                </div>
                <div class="bg-white p-6 rounded-lg shadow-sm text-center">
                    <div class="bg-purple-100 w-14 h-14 rounded-full flex items-center justify-center mx-auto mb-4 text-purple-700">
                        <i class="fas fa-check-circle text-2xl"></i>
                    </div>
                    <h3 class="text-lg font-semibold mb-2 text-gray-800">4. 完成</h3>
                    <p class="text-gray-600 text-sm">一旦所有提交都被成功应用并解决了所有冲突，rebase 完成，当前分支的历史将被更新。</p>
                </div>
            </div>
        </section>

        <!-- Mermaid Chart Section -->
        <section id="mermaid-chart" class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-2 flex items-center">
                <i class="fas fa-project-diagram mr-3 text-purple-600"></i> Rebase 流程可视化
            </h2>
            <div class="mermaid-chart">
                <div class="mermaid">
                    gitGraph
                        commit
                        commit
                        branch feature
                        checkout feature
                        commit
                        commit
                        checkout main
                        commit
                        checkout feature
                        rebase main
                </div>
            </div>
        </section>

        <!-- Important Notes -->
        <section class="bg-yellow-50 border-l-4 border-yellow-400 p-6 rounded-r-lg mb-16">
            <h2 class="text-2xl font-bold mb-4 text-gray-800 flex items-center">
                <i class="fas fa-exclamation-triangle text-yellow-600 mr-3"></i> 重要提示
            </h2>
            <ul class="space-y-3">
                <li class="flex items-start">
                    <i class="fas fa-history text-yellow-600 mt-1 mr-2"></i>
                    <span><strong class="text-gray-800">历史重写</strong>: <code class="bg-yellow-100 px-1.5 py-0.5 rounded">rebase</code> 会重写提交历史，因此它不适合在公共分支上使用。应仅在个人分支或私有分支上进行 <code class="bg-yellow-100 px-1.5 py-0.5 rounded">rebase</code>。</span>
                </li>
                <li class="flex items-start">
                    <i class="fas fa-copy text-yellow-600 mt-1 mr-2"></i>
                    <span><strong class="text-gray-800">备份</strong>: 在进行复杂的 <code class="bg-yellow-100 px-1.5 py-0.5 rounded">rebase</code> 操作前，建议备份当前分支的状态（例如使用 <code class="bg-yellow-100 px-1.5 py-0.5 rounded">git branch backup-branch</code>）。</span>
                </li>
            </ul>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-8">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold">技术小馆</h3>
                    <p class="text-gray-400 mt-1">专注于分享前沿开发技术与实践经验</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition-colors flex items-center">
                        <i class="fas fa-globe mr-2"></i> http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-6 pt-6 text-center text-gray-500 text-sm">
                &copy; 2023 技术小馆. 保留所有权利.
            </div>
        </div>
    </footer>

    <!-- Mermaid JS -->
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            gitGraph: {
                showCommitLabel: true,
                mainBranchName: 'main'
            }
        });
    </script>
</body>
</html>
```